unit saldos;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, Grids, DBGrids, DBTables, StdCtrls, Mask;

type
  TFsaldos = class(TForm)
    Label1: TLabel;
    Button1: TButton;
    Button2: TButton;
    Qcontas: TQuery;
    QcontasCodigo: TStringField;
    QcontasNome: TStringField;
    QcontasData: TDateField;
    QcontasSaldoinicial: TFloatField;
    QcontasSaldoatual: TFloatField;
    QcontasGrupo: TStringField;
    MaskEdit1: TMaskEdit;
    DBGrid1: TDBGrid;
    DSSaldos: TDataSource;
    SaldosDBF: TTable;
    SaldosDBFCODIGO: TStringField;
    SaldosDBFDESCRICAO: TStringField;
    SaldosDBFSALDO: TFloatField;
    Button3: TButton;
    Label4: TLabel;
    MaskEdit2: TMaskEdit;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure FormKeyPress(Sender: TObject; var Key: Char);
    procedure Button3Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Fsaldos: TFsaldos;
  texto : string;
implementation

uses Dados, relsaldos, saldosrel;

{$R *.dfm}

procedure TFsaldos.Button1Click(Sender: TObject);
var
mdevedora, mcredora, mtemp : string;
registro : integer;
mvalor : currency;
msaldoanterior,mdespesas, mreceitas : currency;
mrec101, mrec102, mrec103, mrec104, mrec105, mrec106, mrec107 : currency;
mretiradas, msalarios, mgratificacoes : currency;
mreferencia : boolean;

begin
end;

procedure TFsaldos.Button2Click(Sender: TObject);
begin
close;
end;

procedure TFsaldos.FormKeyPress(Sender: TObject; var Key: Char);
begin
 if key=#13 then     //Enter funciona como TAB
     begin
       SelectNext(ActiveControl,true,true);
     end;
  if key=#27 then     //ESC sai da tela
     begin
       close;
     end;
  key := AnsiUpperCase(Key)[Length(Key)];
end;


procedure TFsaldos.Button3Click(Sender: TObject);
begin

  Application.CreateForm(Tfsaldosrel,fsaldosrel);
  fsaldosrel.QuickRep1.PreviewModal;
  fsaldosrel.Free;



end;

procedure tfSaldos.FormClose(Sender: TObject; var Action: TCloseAction);
begin
saldosdbf.close;
saldosdbf.EmptyTable;
end;




procedure TFsaldos.FormCreate(Sender: TObject);
begin
saldosdbf.Open;

end;

end.
